﻿using Moq;
using Prism.Regions;
using Xunit;
using YF_Music.Core.Events;
using YF_Music.Modules.APP_My.ViewModels;

namespace YF_Music.Modules.APP_My.Tests.ViewModels
{
  public class ViewAViewModelFixture
  {
    Mock<IRegionManager> _regionManagerMock;
    Mock<PublishCoreEvent> publishCoreEventMock;
    const string MessageServiceDefaultMessage = "Some Value";

    public ViewAViewModelFixture()
    {
      _regionManagerMock = new Mock<IRegionManager>();
    }

    [Fact]
    public void MessagePropertyValueUpdated()
    {
      var vm = new APP_MyViewModel(_regionManagerMock.Object,  publishCoreEventMock.Object);

      Assert.Equal(MessageServiceDefaultMessage, vm.Message);
    }

    [Fact]
    public void MessageINotifyPropertyChangedCalled()
    {
      var vm = new APP_MyViewModel(_regionManagerMock.Object,  publishCoreEventMock.Object);
      Assert.PropertyChanged(vm, nameof(vm.Message), () => vm.Message = "Changed");
    }
  }
}
